
<%@ page contentType="text/html;charset=UTF-8"%>
<%@ include file="/WEB-INF/jsp/common/taglibs.jsp"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<%@ include file="/WEB-INF/jsp/common/meta.jsp"%>
<%@ include file="/WEB-INF/jsp/common/title.jsp"%>
<script type="text/javascript">
var frm,form,win,user,grid,org,alertinfo;
	$(function() {
		form = $("form[name=listForm]");
		initGrid(form);
		win = $("#win").window({
			title : "新增",
			modal : true
		});
		
		var columns = [{name:"FLATID", checkbox : true}];
		columns.push({name:'FLATNAME',display:'<fmt:message key="tsysflat.flatname" />',width:65,sortable:true,formatter:function(v,row) {
		   			return '<a href="#" onclick="javascript:show(\''+row.FLATID+'\')">'+v+'</a>';
				}},
				{name:'FLATCODE',display:'<fmt:message key="tsysflat.flatcode" />',width:130,sortable:true},
				{name:'FLATURL',display:'<fmt:message key="tsysflat.flaturl" />',width:80,sortable:true},
		      	{name:'SHORTNAME',display:'<fmt:message key="tsysflat.shortname" />',width:150,sortable:true},
				{name:'FLATDESC',display:'<fmt:message key="tsysflat.flatdesc" />',width:180,sortable:true},
				{name:'REMARK',display:'<fmt:message key="tsysflat.remark" />',width:150,sortable:true}
				);
		var config = {
				fit : true,
				striped: true,  
				url : "${ctx}/uiDataGridDemoController.do?method=list",
				loadMsg : "数据加载中。。。",
				pagination: true,
				rownumbers : false,
				pageList : [50,40,30,20,15],
				columns:[columns],
				onBeforeLoad : function(params) {
					var p = $("form[name=listForm]").getFormParams();
					$.extend(params, p)
				}
			};
		grid = $("#dataGrid").datagrid(config);
		$("#btn_add").click(function() {
			win.window('open');
			win.window("setTitle","新增");
			alertinfo="添加";
			$("#msg").load("${ctx}/uiDataGridDemoController.do?method=add");
		});
		$("#btn_query").click(function() {
			grid.datagrid("reload");
		});
</script>
</head>
<body>
<hih:form bean="request">
	<form method="post" target="_self" action="
		${ctx}/uiDataGridDemoController.do?method=list " name="listForm">
		<input type="hidden" name="error" value='' />
		<div
			style="width: 100%; height: 600px; margin: auto; position: relative;"
			id="container">
			<div class="datagrid-toolbar" region="north" style="height: 175px;"
				border="false">
				<fieldset style="padding: 5px;">
					<legend>查询条件：</legend>
					<table class="FormView" border="0" cellspacing="1" cellpadding="0">
						<col class="Label" />
						<col class="Data" />
						<tr>
							<td><fmt:message key="tsysflat.flatname"/></td>
							<td><input type="text" name="srh_flatname" class="text" /></td> 
						</tr>
					</table><br/>
					<hih:auth operate="QUERY" module="OA_BOONREGISTER" iconCls="icon-search" id="btn_query" value="button.query"></hih:auth>
					</fieldset>
			</div>
			<div region="center" border="false">
				<table id="dataGrid"></table>
			</div>
		</div>
	</form>
	<div id="win" closed="true" style="width: 660px; height: 370px">
		<div id="msg"></div>
	</div>
</hih:form>
</body>
</html>